package top.maof.book.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import top.maof.book.model.Comment;
import top.maof.book.vo.CommentVo;

import java.util.List;

@Mapper
public interface CommentMapper extends BaseMapper<Comment> {
    @Select("select id,content,user_id,book_id,reply,communication,time where id = #{id}")
    Comment find(Integer id);

//    @Insert("insert into comment (id,content,user_id,book_id,reply,time) values (#{id},#{content},#{userId},#{bookId}," +
//            "#{reply},#{time})")
//    int insert(Comment c);


    CommentVo get(int id);

    List<CommentVo> list(int bookId, int start, int pageSize);

    int listCount(int bookId);
}
